<div class="fsh-pop">
    <div id="add_form" class="layui-form">
        <div class="layui-form-item">
            <label class="layui-form-label"><i>*</i>名称</label>
            <div class="layui-input-block">
                <input type="text" name="title" lay-verify="required" placeholder="请输入内容" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label"><i>*</i>父级分类</label>
            <div class="layui-input-block">
                <input lay-verify="required" autocomplete="off" placeholder="请选择父级分类"
                       class="layui-input" id="parent_title">
                <input name="parent_id" type="hidden" id="parent_id">
            </div>
        </div>
    </div>
</div>
<script>
    //监听指定开关
    layui.form.on('switch(switchTest)', function (data) {
        $("#subject").val(this.checked ? 1 : 0);
    });
    var parentId = '';
    $("#parent_title").click(function () {
        showDialog({
            title: '选择父级菜单'
            , template: 'menu'
            , width: 280
            , height: 500
            , yes: function (index, layero) {
                // var res = callbackdata();
                layer.close(index);
                // parentId = res.key;
                // $("#parent_title").val(res.title);
                // $("#parent_id").val(parentId);

            }

        });

    });

</script>
